﻿using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using Sharp.Platform;
using Sharp.Platform.List;
using Sharp.Platform.Other;

namespace Sharp.WebBooter.Areas.CMS.Models
{
    [Title("领域管理")]
    [DataHandler(ModuleOP.Details, "浏览", 0)]
    [DataHandler(ModuleOP.Create, "新增", 1)]
    [DataHandler(ModuleOP.Edit, "修改", 2)]
    [DataHandler(ModuleOP.Delete, "删除", 3)]
    [DataHandler(ModuleOP.Refresh, "刷新", 4)]
    public class FiledIndexViewModel : SharpTreeList
    {
        public FiledIndexViewModel()
        {
            this.Feature = ListFeature.MultiSelect;
        }
        /// <summary>
        /// Id
        /// </summary>
        public System.Guid Id { get; set; }
        /// <summary>
        /// 上级
        /// </summary>
        public System.Guid? ParentId { get; set; }

        /// <summary>
        /// 排序
        /// </summary>
        public int OrderIndex
        {
            get;
            set;
        }
        /// <summary>
        /// 名称
        /// </summary>
        /// <value>标题</value>
        [Display(Name = "名称"), TemplateColumn(Text = "名称", Width = 340, SearchFor = true, TemplateString = "<a class=\"auto\" data-toggle=\"ajaxModal\" href=\"@Url.Action(\"Edit\")/@item.Id\">@item.Name</a>")]
        public string Name { get; set; }

        /// <summary>
        /// 备注
        /// </summary>
        /// <value>备注</value>
        [Display(Name = "备注"), Column(Text = "备注")]
        public string Remark { get; set; }


        /// <summary>
        /// 为控件显示用的属性
        /// </summary>
        /// <![CDATA[<treegrid-@Model.Id treegrid-parent-@Model.ParentId>]]>
        public string Itemclass { get; set; }

        public List<FiledIndexViewModel> Data { get; set; }

    }
}